package com.laotou99.wmsjjj.wmsjjj;

import org.springframework.beans.BeanUtils;

import com.alibaba.fastjson.JSON;

public class MainTest2 {

	public static void main(String[] args) {
		
		test1();

	}

	private static void test1() {

		Test1 t1= new Test1();
		t1.setAbc1("abc1");
		t1.setAbc2("abc2");
		t1.setAbc3("abc3");
		
		Test2 t2 = new Test2();
		BeanUtils.copyProperties(t1, t2);
		
		System.out.println(JSON.toJSON(t2));
	}

}

class Test1
{
	private String abc1;
	private String abc2;
	private String abc3;
	
	public String getAbc1() {
		return abc1;
	}
	public void setAbc1(String abc1) {
		this.abc1 = abc1;
	}
	public String getAbc2() {
		return abc2;
	}
	public void setAbc2(String abc2) {
		this.abc2 = abc2;
	}
	public String getAbc3() {
		return abc3;
	}
	public void setAbc3(String abc3) {
		this.abc3 = abc3;
	}
}

class Test2 extends Test1{
	
	private int i1;
	private int i2;
	private int i3;
	private int i4;
	public int getI1() {
		return i1;
	}
	public void setI1(int i1) {
		this.i1 = i1;
	}
	public int getI2() {
		return i2;
	}
	public void setI2(int i2) {
		this.i2 = i2;
	}
	public int getI3() {
		return i3;
	}
	public void setI3(int i3) {
		this.i3 = i3;
	}
	public int getI4() {
		return i4;
	}
	public void setI4(int i4) {
		this.i4 = i4;
	}
}